CC = g++

CC_DEBUG = $(CC) -g
CC_RELEASE = $(CC) -O3 -DNDEBUG

# need libpng to build
#
PNG_INC = -I/usr/local/ -I/opt/local/include -L/opt/local/lib

all: mytest test bench image

mytest : mytest.cpp GBitmap.cpp GContext0.cpp
	$(CC_DEBUG) mytest.cpp GBitmap.cpp GContext0.cpp -lpng -o mytest

test : test.cpp GBitmap.cpp GContext0.cpp
	$(CC_DEBUG) test.cpp GBitmap.cpp GContext0.cpp -lpng -o test

bench : bench.cpp GTime.cpp GBitmap.cpp GContext0.cpp
	$(CC_RELEASE) bench.cpp GTime.cpp GBitmap.cpp GContext0.cpp -lpng -o bench

image : image.cpp GBitmap.cpp GContext0.cpp
	$(CC_DEBUG) image.cpp GBitmap.cpp GContext0.cpp -lpng -o image

# needs xwindows to build
#
X_INC = -I/usr/X11R6/include -I/usr/X11R6/include/X11 -L/usr/X11R6/lib -L/usr/X11R6/lib/X11 -lX11

xapp: xapp.cpp GContext0.cpp GXWindow.cpp GXWindow.h GBitmap.cpp GTime.cpp
	$(CC_RELEASE) $(X_INC) xapp.cpp GContext0.cpp GXWindow.cpp GBitmap.cpp GTime.cpp -lpng -o xapp

clean:
	rm -rf mytest test bench image xapp GContext.o mytest.o *.dSYM

